package game.source.gui;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

public class Explosion{
	private static Animation anim;
	private static int num_frames;
	
	static{
		BufferedImage img;
		Explosion.num_frames = 24;
		Explosion.anim = new Animation();
		for(int i = 1;i <= Explosion.num_frames ; i++){
			try {
				img = ImageIO.read(new File(Explosion.class.getResource("/images/explosion_300/"+i+".png").getFile()));
				Explosion.anim.add(img);
			} catch (IOException e){
				System.err.println("Não foi possível abrir o arquivo de explosão");
				e.printStackTrace();
			}
		}
	}
	
	public static BufferedImage getFrame(int frame){
		return Explosion.anim.getFrame(frame);
	}
	
	public static int getNumFrames(){
		return Explosion.num_frames;
	}
}
